﻿using System;
using System.Runtime.Serialization;

namespace Sustainalytics.DataLayer.Exceptions.AccountsAndUsers
{
    public class AccountNotFoundException : Exception
    {
        public Guid AccountId { get; private set; }
        public string AccountName { get; private set; }
        public int RowNumber { get; private set; }
        public string WorkSheet { get; private set; }

        public AccountNotFoundException(string message, int rowNumber, string workSheet): base (message)
        {
            RowNumber = rowNumber;
            WorkSheet = workSheet;
        }

        public AccountNotFoundException(string message, string accountName): base (message)
        {
            AccountName = accountName;
            AccountId = Guid.Empty;
        }

        public AccountNotFoundException(string message, Guid accountId)
            : base(message)
        {
            AccountId = accountId;
        }

        public AccountNotFoundException(string message, Exception innerException, Guid accountId)
            : base(message, innerException)
        {
            AccountId = accountId;
        }
    }


    [Serializable]
    public class IpAccountOverlapingException : Exception
    {
        //
        // For guidelines regarding the creation of new exception types, see
        //    http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpgenref/html/cpconerrorraisinghandlingguidelines.asp
        // and
        //    http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dncscol/html/csharp07192001.asp
        //

        public IpAccountOverlapingException()
        {
        }

        public IpAccountOverlapingException(string message) : base(message)
        {
        }

        public IpAccountOverlapingException(string message, Exception inner) : base(message, inner)
        {
        }

        protected IpAccountOverlapingException(
            SerializationInfo info,
            StreamingContext context) : base(info, context)
        {
        }
    }

    [Serializable]
    public class AccountIpAuthenticationInvalidException : Exception
    {
        //
        // For guidelines regarding the creation of new exception types, see
        //    http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpgenref/html/cpconerrorraisinghandlingguidelines.asp
        // and
        //    http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dncscol/html/csharp07192001.asp
        //

        public AccountIpAuthenticationInvalidException()
        {
        }

        public AccountIpAuthenticationInvalidException(string message) : base(message)
        {
        }

        public AccountIpAuthenticationInvalidException(string message, Exception inner) : base(message, inner)
        {
        }

        

        protected AccountIpAuthenticationInvalidException(
            SerializationInfo info,
            StreamingContext context) : base(info, context)
        {
        }
    }
}
